Skip to content
This repository was archived by the owner on Oct 6, 2026. It is now read-only.

Fix 'object of type "filter" has no len()' issue in shopify_api.py - #456

Merged
Paulinakhew merged 4 commits into
masterfrom
paulinakhew-fix-issue-426
Feb 8, 2021
Merged

Paulinakhew merged 4 commits into
masterfrom
paulinakhew-fix-issue-426

Conversation

@Paulinakhew

@Paulinakhew Paulinakhew commented Feb 8, 2021 •

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Fixes #426

  • previously, the code tried to get the length and index of a filter
  • if you print out a filter, it will look like this
>>> f
<filter object at 0x10b0cedc0>
  • this filter object has no len() attribute
>>> len(f)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: object of type 'filter' has no len()

WHAT is this pull request doing?

  • by converting the filter into a list, we will be able to get the length and index of a filter

Checklist

  • I have updated the CHANGELOG (if applicable)
  • I have followed the Shopify Python guide

@Paulinakhew
Paulinakhew requested a review from mllemango February 8, 2021 17:07

@mllemango mllemango left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Paulinakhew
Paulinakhew merged commit 4f2f800 into master Feb 8, 2021
@Paulinakhew
Paulinakhew deleted the paulinakhew-fix-issue-426 branch February 8, 2021 18:16
@NabeelAhsen NabeelAhsen mentioned this pull request Mar 17, 2021
2 tasks done

This branch had an error being deployed

1 failed deployment
pypi — f2202c72 Deployed Apr 9, 2024 by shopify-shipit[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

python 3.8 shopify_api.py line 55, TypeError: object of type 'filter' has no len()

3 participants